package com.system.shiro.token;

import org.apache.shiro.authc.UsernamePasswordToken;

public class MyUserToken extends UsernamePasswordToken{
	
	private static final long serialVersionUID = 1L;
	
	private String randImg;
	private String msg;
	private String correctImg;
	public MyUserToken(){
		
	}
	
	public MyUserToken(String username,String password, String randImg,String correctImg){
		this.setUsername(username);
		this.setPassword(password.toCharArray());
		this.randImg = randImg;
		this.correctImg = correctImg;
	}
	
	
	public String getCorrectImg() {
		return correctImg;
	}

	public void setCorrectImg(String correctImg) {
		this.correctImg = correctImg;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getRandImg() {
		return randImg;
	}
	public void setRandImg(String randImg) {
		this.randImg = randImg;
	}

	public void clear()
    {
        this.setUsername(null);
        this.setHost(null);
        this.setRememberMe(false);
        if(this.getPassword() != null)
        {
        	char[] password = this.getPassword();
            for(int i = 0; i < password.length; i++)
                password[i] = '\0';

            this.setPassword(null);
        }
        this.correctImg = null;
        this.randImg = null;
    }
	
}
